package bloomFilter;

import orestes.bloomfilter.BloomFilter;
import orestes.bloomfilter.FilterBuilder;

public class BloomFilterApp {
    public static void main(String args[]) {
        BloomFilter<String> bf = new FilterBuilder(1000000, 0.01).buildBloomFilter();
        for (int i = 0; i < 1000000; i++) {
            bf.add("element" + i);
        }

        int count = 0;

        for (int i = 1000000; i < 2000000; i++) {
            boolean isContain = bf.contains("element" + i);
            if (isContain) {
                count++;
            }
        }
        System.out.println(String.format("count:%d", count));
    }
}
